package cn.wolfcode.p2p.business.service;

import cn.wolfcode.p2p.business.domain.Bid;
import cn.wolfcode.p2p.business.domain.BidRequest;

import java.math.BigDecimal;

public interface IBidService {
    /**
     * 查询投资人对某一个借款的投资总额
     * @param bidRequestId 标的id
     * @param userId 用户id
     * @return
     */
    BigDecimal getTotalBidAmountByBidUserIdAndBidRequestId(Long bidRequestId, Long userId,Integer bidRequestState);

    /**
     * 保存投标记录
     * @param bidRequest 借款对象
     * @param amount 投资金额
     */
    void save(BidRequest bidRequest, BigDecimal amount);

    /**
     * 批量更新投标的状态
     * @param bidRequestId 借款对象的id
     * @param bidrequestState 借款对象的状态
     */
    void updateByBidRequestIdAndState(Long bidRequestId, int bidrequestState);

    /**
     * 获取bid
     * @param bidId
     */
    Bid getBid(Long bidId);
}
